function cfdSetBoundaryPatchs(iBPatch,iBface,var1,var2)
%--------------------------------------------------------------------------
%  Written by LiuHaHa @ NWPU, 2022 01 
%  Contact me at: liuzhikan@mail.nwpu.edu.cn
%==========================================================================
% Routine Description:
%   This function calculate the flux at the boundary face
%--------------------------------------------------------------------------
global cfdFlow;
cfdBoundaries = cfdFlow.mesh.cfdBoundaryPatchesArray;

if(strcmp(cfdBoundaries{iBPatch}.name,'wall') || strcmp(cfdBoundaries{iBPatch}.name,'WALL'))
    cfdSetWallBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'wallslip') || strcmp(cfdBoundaries{iBPatch}.name,'WALLSLIP'))
    cfdSetWallSlipBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'in') || strcmp(cfdBoundaries{iBPatch}.name,'IN'))
    cfdSetInletBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'out') || strcmp(cfdBoundaries{iBPatch}.name,'OUT'))
    cfdSetOutletBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'symmetry') || strcmp(cfdBoundaries{iBPatch}.name,'SYMMETRY') ... 
       || strcmp(cfdBoundaries{iBPatch}.name,'sym') || strcmp(cfdBoundaries{iBPatch}.name,'SYM') )
    cfdSetSymmetryBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'far') || strcmp(cfdBoundaries{iBPatch}.name,'farfield') ... 
       || strcmp(cfdBoundaries{iBPatch}.name,'FAR') || strcmp(cfdBoundaries{iBPatch}.name,'FARFIELD') )
    cfdSetFarfieldBoundary(iBPatch,iBface,var1,var2);
elseif(strcmp(cfdBoundaries{iBPatch}.name,'ringleb') )
    cfdSetRinglebBoundary(iBPatch,iBface,var1,var2);
else
    error('\nError: The type of boundary doesnot exist \n');
end































